<?php
	include '../config.php';
	include '../includes/user.class.php';
	$isloggedin = CheckLogin($mysql);
	$perms = CheckPermissions($mysql);
	if($perms < 2){
		die('<meta HTTP-EQUIV="REFRESH" content="0; url=../index.php">');
	}
	
	include '../includes/blog.php';
	$blog = new Blog();
?>

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="admin.js"></script>
</head>
<body onload="Setup()">

	<div class="container">
		<h1>FileWire Administration</h1>
		<table><tr><td valign="top" class="navigation">
			<h2>Navigation</h2>
			<ul>
				<li>View Your Site</li>
				<li onclick="ShowPage('content_overview')">Dashboard</li>
				<li onclick="ShowPage('content_blog');$('#saveblogbtn').hide()">Blog</li>
			</ul>
			<ul>
				<li onclick="ShowPage('content_settings')">Basic Settings</li>
				<li onclick="ShowPage('content_users')">Users</li>
				<li onclick="ShowPage('content_permissions')">Permissions</li>
				<li onclick="ShowPage('content_posts')">Threads/Posts</li>
				<li onclick="ShowPage('content_categories')">Categories</li>
				<li onclick="ShowPage('content_maintenance')">Maintenance</li>
			</ul>
			<ul>
				<li><a target="_blank" href="http://code.google.com/p/filewire/w/list">Help</a></li>
				<li><a target="_blank" href="http://filewi.re">FileWi.re</a></li>
			</ul>
		</td><td valign="top" class="content">
			<div id="content_overview">
				<h2>Overview</h2>
			</div>
			<div id="content_blog">
				<h2>Blog</h2>
				<h3>Posts</h3>
				<div id="adminbloglist"><?php $blog->AdminList($mysql,0); ?></div>
				<h3 id="blogh3"></h3>
				<table><tr><td>Title: </td><td><input type="text" id="newposttitle" /></td></tr>
				<tr><td valign="top">Content: </td><td><textarea cols="53" rows="20" id="newpostcontent"></textarea></td></tr>
				<tr><td colspan="2" align="right"><font id="blogsubmitresult"></font><input id="delblogbtn" onclick="DeleteBlogPost()" type="button" value="Delete" /><input id="newblogbtn" onclick="NewBlogPost()" type="button" value="Submit" /><input id="saveblogbtn" onclick="SaveBlogPost()" type="button" value="Save" /></td></tr></table>
			</div>
			<div id="content_settings">
				<h2>Basic Settings</h2>
			</div>
			<div id="content_users">
				<h2>Users</h2>
			</div>
			<div id="content_permissions">
				<h2>Permissions</h2>
			</div>
			<div id="content_posts">
				<h2>Threads/Posts</h2>
			</div>
			<div id="content_categories">
				<h2>Categories</h2>
			</div>
			<div id="content_maintenance">
				<h2>Maintenance</h2>
			</div>
		</td></tr></table>
	
	</div>

</body>
</html>